<?php

/* Copyright (c) 2007 Alec Henriksen
 * phpns is free software; you can redistribute it and/or modify it under the
 * terms of the GNU General Public Licence (GPL) as published by the Free
 * Software Foundation; either version 2 of the Licence, or (at your option) any
 * later version.
 * Please see the GPL at http://www.gnu.org/copyleft/gpl.html for a complete
 * understanding of what this license means and how to abide by it.
*/

//Create SQL query for all vars known.

$siteonsql = "SELECT * FROM gconfig";
$siteonres = mysql_query($siteonsql) or die($error['query']);

while ($gcrow = mysql_fetch_assoc($siteonres)) {      //fetch data

if ($gcrow['name'] == "siteonline") {
if ($gcrow['v1'] == "0") { $globalvars['siteonline'] = "Yes"; } else { $globalvars['siteonline'] = "No"; }
} elseif ($gcrow['name'] == "commenabled") {
if ($gcrow['v1'] == "0") { $globalvars['commenabled'] = "Yes"; } else { $globalvars['commenabled'] = "No"; }
} elseif ($gcrow['name'] == "admin_notes") {
$globalvars['admin_notes'] = $gcrow['v3'];
}
}


//time and date vars
$globalvars['time'] = time();
$globalvars['ftime'] = strftime("%I:%M %p", time());
$globalvars['fdate'] = strftime("%A %B %d, %Y", time());

?>
